<?php
/**
 * Created by PhpStorm.
 * @author zhuyujun
 * Date: 2017/10/24
 * Time: 16:25
 */
namespace App\Eloquent\Ygt;

use Framework\BaseClass\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class OrderProcess extends Model
{
    use SoftDeletes;
    protected $dates = ['deleted_at'];
    protected $table = 'ygt_order_process';


    public static function getListWithOrder($companyId){
        return self::leftJoin('ygt_order','ygt_order.id','ygt_order_process.order_id')
            ->where('ygt_order_process.company_id',$companyId)
            ->select(
                'ygt_order.order_title',
                'ygt_order.order_type',
                'ygt_order.finished_date',
                'ygt_order.customer_name',
                'ygt_order.product_name',
                'ygt_order.product_num',
                'ygt_order_process.*'
            )
            ->orderBy('id','desc')->get();
    }
}
